#pragma once
#include <functional>
#include <memory>
typedef  std::function<void(const char* processed_frame)> RetriveFrameCallback;
#include <opencv2/core/mat.hpp>
class COpenglWrapper;
 class __declspec(dllexport) CBeautyCore
{
public:
	CBeautyCore();
	~CBeautyCore();
public:
	bool InitializeBeautyCore(int w, int h);
	//register callback to retrive processed frame
	void RegisterCallback(RetriveFrameCallback callback);
	//transfer original fram into beatuty core
	cv::Mat ProcessFrame(const cv::Mat& frame);

	bool ProcessFrame(uint8_t* y,uint8_t* u, uint8_t* v,
						int stride_y, int stride_u, int stride_v);

	//set whitening param
	void SetWhiteningParam(const float factor);
private:
	std::shared_ptr<COpenglWrapper> opengl_wrapper_;
	int width;
	int height;
	int buff_size;
};

